package cn.ryh.componentscan;

import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.context.annotation.ComponentScan;

/**
 * @ComponentScan 可以使用通配符
 * basePackages 指定包路径
 * basePackageClasses 指定类路径
 * 可以使用多个ComponentScan注解,这时及时没将启动类的包路径也加入进去也会扫描到
 * @author Rao
 */
@SpringBootApplication
// @ComponentScan(basePackages = {"cn.ryh.*"})
@ComponentScan(basePackages = {"cn.ryh.testcomponentscan.test1"})
@ComponentScan(basePackageClasses = {cn.ryh.testcomponentscan.test2.MyStartupRunnerTwoTest2.class})
public class ComponentScanApplication {

    public static void main(String[] args) {
        SpringApplication.run(ComponentScanApplication.class, args);
    }

}
